ajax('/admin/user/detail', function (data) {
    console.log(data)
    document.querySelector('#username').value = data.data.username
    document.querySelector('#nickname').value = data.data.nickname
    document.querySelector('#email').value = data.data.email
    document.querySelector('.user_pic').src = data.data.userPic
    document.querySelector('#password').value = data.data.password
})
document.querySelector('.btn-success').onclick = function (event) {
    event.preventDefault();
    let formdata = new FormData()
    let userPic = document.querySelector('#exampleInputFile').files[0]
    formdata.append('username', document.querySelector('#username').value)
    formdata.append('nickname', document.querySelector('#nickname').value)
    formdata.append('email', document.querySelector('#email').value)
    formdata.append('userPic', userPic)
    formdata.append('password', document.querySelector('#password').value)
    ajax('/admin/user/edit', undefined, 'post', formdata)
}